Kinetis SDK Demo Applications User Guide  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
low_power_adc.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc. *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without modifi- *
6  * cation, are permitted provided that the following conditions are met: *
7  * *
8  * o Redistributions of source code must retain the above copyright notice, *
9  * this list of conditions and the following disclaimer. *
10  * *
11  * o Redistributions in binary form must reproduce the above copyright notice, *
12  * this list of conditions and the following disclaimer in the documentation *
13  * and/or other materials provided with the distribution. *
14  * *
15  * o Neither the name of Freescale Semiconductor, Inc. nor the names of its *
16  * contributors may be used to endorse or promote products derived from this *
17  * software without specific prior written permission. *
18  * *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" *
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE *
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF *
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN *
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) *
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
29  * POSSIBILITY OF SUCH DAMAGE. *
30  * *
31  *******************************************************************************/
32 
33 
34 #ifndef __LOWPOWER_ADC_H__
35 #define __LOWPOWER_ADC_H__
36 
37 #include <stdint.h>
38 
39 
43 typedef struct lowPowerAdcBoundaries
44 {
45  uint32_t upperBoundary;
46  uint32_t lowerBoundary;
48 
49 
53 void init_hardware(void);
54 
58 void LowPowerTimerIRQHandler(void);
59 
63 void ADC1IRQHandler(void);
64 
68 void InitLowPowerTmr(void);
69 
75 uint32_t GetCurrentTempValue(void);
76 
86 lowPowerAdcBoundaries_t TempSensorCalibration(uint32_t updateBoundariesCounter,
87  uint32_t *tempArray);
88 
89 #endif /* __LOWPOWER_ADC_H__ */
90 
91 /*******************************************************************************
92  * EOF
93  *******************************************************************************/
void LowPowerTimerIRQHandler(void)
Low Power Timer Interrupt handler. Clear LPT Compare flag.
Definition: low_power_adc.c:102
uint32_t lowerBoundary
Definition: low_power_adc.h:46
static void init_hardware(void)
Init hardware for TWR-K70F120M.
Definition: flexcan_demo/src/main.c:95
uint32_t upperBoundary
Definition: low_power_adc.h:45
void ADC1IRQHandler(void)
ADC Interrupt handler. Get current ADC value and set conversionCompleted flag.
Definition: low_power_adc.c:133
void InitLowPowerTmr(void)
Initialize Low Power Timer. Use 1 kHz LPO with no preescaler and enable LPT interrupt.
Definition: low_power_adc.c:108
Boundaries struct.
Definition: low_power_adc.h:43
uint32_t GetCurrentTempValue(void)
Calculate current temperature.
Definition: low_power_adc.c:142
lowPowerAdcBoundaries_t TempSensorCalibration(uint32_t updateBoundariesCounter, uint32_t *tempArray)
Calculate current temperature.
Definition: low_power_adc.c:150